function lst = remove_if(lst, pred)
%REMOVE_IF Removes the elements satisfying specified condition
%
% [ Syntax ]
%   - lst = remove_if(lst, pred)
%
% [ Description ]
%   - lst = remove_if(lst, pred) removes the elements for which pred(x)
%     is true.
%
% [ History ]
%   - Created by Dahua Lin, on Jan 5, 2008
%

p = cellfun(pred, cell(lst));
if ~islogical(p)
    p = logical(p);
end

lst = remove_at(lst, p);